package com.hujing.sqlinjection.controller;


import com.hujing.sqlinjection.service.CityMenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController {

    @Autowired
    private CityMenuService cityMenuService;
    
    @GetMapping("/test")
    public Integer test(@RequestParam("cityName") String cityName) {
        return cityMenuService.sqlInjectTest(cityName);
    }

    @GetMapping("/test2")
    public Integer test2(@RequestParam("cityName") String cityName) {
        return cityMenuService.forbittenSqlInjectTest(cityName);
    }

}
